---
- name: Verify
  hosts: localhost
  connection: local
  gather_facts: true

  tasks:
    - name: Pause for job to complete.
      ansible.builtin.pause:
        seconds: 5

    - name: Get 'hello' Job info.
      kubernetes.core.k8s_info:
        kind: Job
        name: hello
        namespace: default
      register: jobs

    - name: Debug.
      ansible.builtin.debug:
        var: jobs

    - name: Assert that 'hello' Job ran successfully.
      ansible.builtin.assert:
        that: jobs['resources'][0]['status']['succeeded'] == 1
